/**
 * Creat by TanLei
 * Description:
 * User:86183
 * Date:2022-06-16
 * Time:13:51
 */
public class NewCarDemo {
    public static void main(String[] args) {
        Tire tire = new Tire(35,"红褐色");
        Bottom bottom = new Bottom(tire);
        FrameWork frameWork = new FrameWork(bottom);
        Car car = new Car(frameWork);
        car.run();
    }
    static class Car{
        private FrameWork frameWork;

        public Car(FrameWork frameWork) {
            this.frameWork = frameWork;
        }

        public void run(){
            frameWork.run();
        }
    }
    static class FrameWork{
        private Bottom bottom;

        public FrameWork(Bottom bottom) {
            this.bottom = bottom;
        }

        public void run(){
            bottom.run();
        }
    }
    static class Bottom{
        private Tire tire;

        public Bottom(Tire tire) {
            this.tire = tire;
        }
        public void run(){
             tire.run();
        }
    }
    static class Tire{
        private int size = 15;
        private String color = "黑色";

        public Tire(int size, String color) {
            this.size = size;
            this.color = color;
        }

        public Tire(int size) {
            this.size = size;
        }

        public void run(){
            System.out.println("轮胎尺寸："+size+" 颜色： "+color);
        }
    }
}
